﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<iss.sg4210.se18.team6s.jass.DAL.DataAccess.MetaData.SearchModel>" %>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="TitleContent">
    Search
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Search</h2>
    <%//using (Ajax.BeginForm("Search", new AjaxOptions() { UpdateTargetId = "SearchResults" }))
        using (Html.BeginForm())
        {%>
    <%: Html.ValidationSummary(true)%>
    <table>
        <tr>
            <td valign="top">
                <label for="lblTitle">
                    Title</label>
            </td>
            <td valign="top">
                :
            </td>
            <td valign="top">
                <%:Html.TextBoxFor(m=>m.Title) %>
            </td>
        </tr>
        <tr>
            <td valign="top">
                <label for="lblExperience">
                    Experience</label>
            </td>
            <td valign="top">
                :
            </td>
            <td valign="top">
                <%:Html.TextBoxFor(m=>m.Experience) %>
                <%: Html.ValidationMessage("Experience")%>
            </td>
        </tr>
        <tr>
            <td valign="top">
                <label for="lblSalary">
                    Salary</label>
            </td>
            <td valign="top">
                :
            </td>
            <td valign="top">
                <label for="lblSalaryFrom">
                    From</label>&nbsp;&nbsp;
                <%:Html.TextBoxFor(m=>m.SalaryFrom) %>
                <%: Html.ValidationMessage("SalaryFrom")%><br />
                <label for="lblSalaryTo">
                    To</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <%:Html.TextBoxFor(m=>m.SalaryTo) %>
                <%: Html.ValidationMessage("SalaryTo")%>
            </td>
        </tr>
        <tr>
            <td valign="top">
                <label for="lblCompany">
                    Company</label>
            </td>
            <td valign="top">
                :
            </td>
            <td valign="top">
                <%:Html.TextBoxFor(m=>m.Company) %>
            </td>
        </tr>
        <tr>
            <td valign="top">
                <label for="lblSkills">
                    Skills</label>
            </td>
            <td valign="top">
                :
            </td>
            <td valign="top">
                <%:Html.TextBoxFor(m=>m.Skills) %>
            </td>
        </tr>
        <tr>
            <td valign="top">
                <input type="submit" name="searchButton" value="Search" class="cssbutton" />
            </td>
            <td valign="top">
                &nbsp;&nbsp;&nbsp;&nbsp;
            </td>
            <td valign="top">
                <input type="submit" name="searchButton" value="Display All" class="cssbutton" />
            </td>
        </tr>
    </table>
    <%} %>
    <br />
    <br />
    <div id="SearchResults">
        <%
            if (Model != null && Model.Result != null)
            {
                if (Model.Result.Count() > 0)
                {
                    Html.RenderPartial("SearchResults", Model.Result);
                }
                else
                { %>
        <div>
            No data Found!
        </div>
        <% 
            }
            }
        %>
    </div>
</asp:Content>
